package org.ilc.push;

import java.io.IOException;

import org.ilc.push.socket.IConnectionListener;
import org.ilc.push.socket.IHeader;
import org.ilc.push.socket.SocketConnection;

public class SampleTestSocket {

	
	public static void main(String[] a) throws IOException{
	
		//System.out.println( Integer.parseInt(null));
		
		SocketConnection conn=
			new SocketConnection(new IConnectionListener(){

				@Override
				public void messageReceived(IHeader header, byte[] body) {
					// TODO Auto-generated method stub
                    System.out.println(header.toString());
                    if (body != null && body.length > 0)
                        System.out.println(new String(body));
				}

				@Override
				public void onClose() {
					// TODO Auto-generated method stub
					
				}

				@Override
				public void onConnection(SocketConnection conn) {
					// TODO Auto-generated method stub
					
//				}}, 100, "201301001", "301001");
				}}, 100, "t2025087", "025087","2","2");
//				}}, 1000, "lenbo2", "301001");
//		conn.connection("58.134.1.123", 8889);
		conn.connection("192.168.7.53", 8889);
//        conn.connection("211.103.210.25", 8889);
//		conn.connection("127.0.0.1", 8889);
		System.in.read();
	}
}
